import request from '@/config/axios'

// 关键字 VO
export interface KeyWordVO {
  id: number // 唯一自增id
  keyWord: string // 关键字名字
}

// 关键字 API
export const KeyWordApi = {
  // 查询关键字分页
  getKeyWordPage: async (params: any) => {
    return await request.get({ url: `/lm/key-word/page`, params })
  },

  // 查询关键字详情
  getKeyWord: async (id: number) => {
    return await request.get({ url: `/lm/key-word/get?id=` + id })
  },

  // 新增关键字
  createKeyWord: async (data: KeyWordVO) => {
    return await request.post({ url: `/lm/key-word/create`, data })
  },

  // 修改关键字
  updateKeyWord: async (data: KeyWordVO) => {
    return await request.put({ url: `/lm/key-word/update`, data })
  },

  // 删除关键字
  deleteKeyWord: async (id: number) => {
    return await request.delete({ url: `/lm/key-word/delete?id=` + id })
  },

  // 导出关键字 Excel
  exportKeyWord: async (params) => {
    return await request.download({ url: `/lm/key-word/export-excel`, params })
  }
}